import 'package:duuchin/config/app_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class RootPageHead extends StatelessWidget {
  const RootPageHead({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Image.asset(
          'assets/images/common/logo.png',
          height: 40,
        ),
        Expanded(
          child: _searchContent(),
        ),
        Image.asset(
          'assets/images/icons/msg.png',
          height: 30,
        ),
      ],
    );
  }

  Widget _searchContent() {
    return InkWell(
      child: Container(
        height: 30,
        margin: EdgeInsets.symmetric(horizontal: 7),
        decoration: BoxDecoration(
          color: AppColors.page,
          borderRadius: BorderRadius.circular(30),
        ),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Padding(
              padding: EdgeInsets.only(left: 6, right: 3),
              child: Icon(
                Icons.search,
                size: 18,
                color: AppColors.un3active,
              ),
            ),
            Text(
              '搜索关键词',
              style: TextStyle(
                fontSize: 13,
                color: AppColors.un3active,
              ),
            )
          ],
        ),
      ),
      onTap: (){
        print('触发了点击事件');
      },
    );
  }
}
